1. Field of the Invention
The present invention generally relates to image processing and, more particularly, to an image processing apparatus configured to execute processing for filling a character image portion.
2. Description of the Related Art
In recent years, electronic information has been widely used. More specifically, a conventional system has been widespread that scans an image of a document by using a scanner and acquires and stores image data of the scanned document instead of merely filing a copy of the document printed on paper. A conventional system like this can transmit the acquired electronic data (image) of the document to another apparatus.
Meanwhile, it is desired by the market, in order to reduce costs of transmitting and storing electronic data, that an electronic document be compressed at a high compression ratio. In addition, it is also desired by the market that electronic data can be partially edited and reused. Furthermore, it is yet also desired that electronic image data have such a high image quality that cannot be degraded by either enlargement or reduction.
In compressing an image of a document mixedly including text regions and photo regions, if image data of a document like this is compressed by a lossless compression method, a high image quality can be achieved while the compression ratio cannot become sufficiently high. On the other hand, if image data of such a document is compressed by a lossy compression method (Joint Photographic Experts Group (JPEG) or the like), a sufficiently high compression ratio can be achieved while the image quality of a text region may be degraded.
In order to address these problems, a conventional method segments an electronic document image into text regions, line drawing regions, and photo regions and compresses each region by using a compression method appropriate for the type of each region. More specifically, Japanese Patent Application Laid-Open No. 2002-077633 extracts a text region and Modified Modified Read (MMR)—compresses the extracted text region. Furthermore, this conventional method colors a text region of an original image with a color used in a surrounding portion and reduces the size of the image data. In addition, the conventional method JPEG-compresses the data and generates a portable document format (PDF) file based on the compressed data.
Japanese Patent Application Laid-Open No. 2002-077633 discusses a method for generating a binary image based on an image to be processed, extracting a text region based on an aggregate of pixels of the binary image, and colors the extracted text region with an average color of surrounding pixels.
In addition, Japanese Patent Application Laid-Open No. 2007-272601 converts a text region and a line drawing region into vector data, JPEG-compresses regions other than text regions, which cannot be easily reproduced by vectorization (i.e., a photo region or the like), combines compressed data of the regions into one electronic file, and outputs the electronic file.
Color information of pixels surrounding a text region is easily affected by bleeding that may occur around pixels of a character included in the text region. Accordingly, as discussed in Japanese Patent Application Laid-Open No. 2002-077633, in order to determine a color used for filling a text region in generating a background image excluding text regions, it is necessary to acquire color information of a large number of pixels and calculate an average of the acquired color information.
However, in this case, it takes time for executing processing for calculating an average color for each character image. In addition, a background of a text region may not always be filled in a single color. More specifically, if a background of a text region is filled in a plurality of colors (in gradation, for example), it is not very effective to calculate and use an average color.